#@layoutT("出账统计")
#define css()
<style type="text/css">
    #chart{
        width:100%;height:550px;margin-top:30px;
    }
    .chart{
        width:50%;height:250px;margin-top:30px;float: left;display: none;
    }
</style>
#end

#define main()
#@formStart()
#@queryStart('month')
<label class="control-label">选择月份：</label>
<input type="search" id="month" autocomplete="off" class="layui-input" placeholder="选择月份"/>
#@queryEnd()

<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="bar" style="width: 50%;height:400px;float: left"></div>
<div id="line" style="width: 50%;height:400px;float: left"></div>
<div id="pie" style="width: 50%;height:400px;float: left"></div>
<div id="chart" style="width: 50%;height:400px;float: left"></div>
<div id="chart0" class="chart"></div>
<div id="chart1" class="chart"></div>
<div id="chart2" class="chart"></div>
<div id="chart3" class="chart"></div>
#end


#define js()
<script src="#(path)/static/libs/echarts/echarts.min.js"></script>
<script src="#(path)/static/libs/echarts/ecstat/ecStat.min.js"></script><!-- 工具条js -->
<script src="#(path)/static/libs/echarts/echarts.tool.js"></script>
<script type="text/javascript">
    $(function(){
        init();
    })

    function init(month) {
        //柱状图
        //变量配置
        var config=echart.config;
        console.log(config)
        config.title="本月采购金额统计";
        config.title_x="center";
        config.subtitle="测试";
        config.legend=['金额'];
        config.legend_x="left";
        //config.xName="类型";
        config.xAxis=["采购商品1","采购商品2","采购商品3","采购商品4","采购商品5","采购商品6"];
        //config.yName="数量";
        config.seriesName="金额";
        config.seriesData=[5, 20, 36, 10, 10, 20];
        config.divId="bar";
        echart.bar(config);

        //折线图
        config.title="本月采购数量统计";
        config.legend=['数量'];
        config.seriesName="数量";
        config.seriesData=[10,30,50,60,70,100];
        config.divId="line";
        echart.line(config);

        //饼图
        config.title="本月支出情况统计";
        config.legend=["已支付","未支付"];
        config.Name='支出情况';
        config.seriesPieData=[{value:10,name:'未支付'},{value:90,name:'已支付'}];
        config.divId="pie";
        config.tooltipText="元";
        echart.pie(config);


        //采购产品花费金额情况
        var money_echart=new Echart();
        money_echart.getData("#(path)/erp/report/outcome/reportPurchaseRate?month="+$("#month").val(),null);
    }

</script>
#end

<!-- 时间控件 -->
#define layuiFunc()
    laydate.render({
        elem: '#month',
        type: 'month',
        value: new Date(),
        done: function(value, date, endDate){
debugger;
            $("#month").val(value)
            init();
        }
    });

#end